<template>
	<!-- chen 2022/1/24 9:55 小雨 -->
	<view class="atticle_detail">
		<!-- 文章详情页面 -->
		<view class="detail">
			<!-- 详情标题 -->
			<view class="detail_title">
				{{articleDetails.title}}
			</view>
			<!-- 来源和日期 -->
			<u-row class="source_views" justify="space-between">
				<u-col span="6">
					<!-- <view>火源社区</view> -->
				</u-col>
				<u-col span="6" class="views">
					发布时间 {{handleTime}}
				</u-col>
			</u-row>
			<!-- 详情 -->
			<view class="detail_info">
				<!-- 文章一二分类标题 -->
				<!-- <view class="info_title">
					<image src="../../static/img/bdimg.jpeg" mode=""></image>
				</view> -->
				<!-- 文章详情内容信息 -->
				<view class="info_conent">
					{{articleDetails.content}}
				</view>
			</view>
		</view>
		<view class="empty_placeholder">
		</view>
		<!-- 底部评论 -->
		<view class="comment_bar">
			<u-row>
				<u-col span="6">
					<u-input placeholder="发表评论" class="comment_input" />
				</u-col>
				<u-col span="6">
					<u-row class="comment_options">
						<u-col span="3">
							<u-icon name="chat" size="38"></u-icon>
						</u-col>
						<u-col span="3">
							<u-icon name="thumb-up" size="38"></u-icon>
						</u-col>
						<u-col span="3">
							<u-icon name="star" size="38"></u-icon>
						</u-col>
						<u-col span="3">
							<u-icon name="share" size="38"></u-icon>
						</u-col>
					</u-row>
				</u-col>
			</u-row>
		</view>
	</view>
</template>

<script>
	import {
		articleDetail
	} from '@/config/api.js';
	export default {
		data() {
			return {
				articleDetails: {}
			}
		},
		onLoad(option) {
			articleDetail(option).then(res => {
				console.log(res)
				this.articleDetails = res.data
			})
		},
		computed: {
			handleTime() {
				let {
					createTime
				} = this.articleDetails
				// 第一次拿到的值是undefined所以做一下判断
				if (createTime) {
					// 分割取T前面
					let time = createTime?.split('T')
					// console.log(time)
					return time[0]
				}
			}
		}
	}
</script>

<style lang="scss">

</style>
